class Solution:
    def EntryNodeOfLoop(self, pHead):
        fast, slow = pHead, pHead
        while True:
            if not fast or not fast.next:
                return None

            slow = slow.next
            fast = fast.next.next
            if slow == fast:
                break

        fast = pHead
        while slow != fast:
            fast = fast.next
            slow = slow.next

        return fast